<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->increments('id')->comment('商品id');
            $table->string('name')->default('')->comment('商品名称');
            $table->string('price')->default('')->comment('价钱');
            $table->smallInteger('sort')->default(50)->comment('排序');
            $table->tinyInteger('enabled')->default(1)->comment('是否显示');
            $table->string('thumb_pic')->default('')->comment('缩略图');
            $table->text('content')->comment('商品介绍');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
